/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zcp.notepad;

import android.net.Uri;
import android.provider.BaseColumns;

/**
 * Convenience definitions for NotePadProvider
 */
public final class NotePad {
    public static final String AUTHORITY = "com.zcp.notepad.provider.NotePad";

    // This class cannot be instantiated
    private NotePad() {
    }

    /**
     * Settings table
     */
    public static final class Settings implements BaseColumns {
        private Settings() {
        }

        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/settings");

        /**
         * The password setting
         * <P>
         * Type: TEXT
         * </P>
         */
        public static final String PASSWORD = "password";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single
         * note.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.zcp.settings";
    }

    /**
     * widget table
     */
    public static final class WidgetInfo implements BaseColumns {
        private WidgetInfo() {
        }

        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/widget");

        public static final String[] WIDGET_PROJECTION = new String[] {
                WidgetInfo.NOTE_ID, WidgetInfo.WIDGET_ID, WidgetInfo.WIDGET_SIZE
        };

        /**
         * widget id
         * <P>
         * Type: INTEGER
         * </P>
         */
        public static final String WIDGET_ID = "widget_id";

        /**
         * widget size,22 means 2x2,44 means 4x4
         * <P>
         * Type: INTEGER
         * </P>
         */
        public static final String WIDGET_SIZE = "widget_size";

        /**
         * note id
         * <P>
         * Type: INTEGER
         * </P>
         */
        public static final String NOTE_ID = "note_id";

        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.zcp.widget";
    }

    /**
     * Notes table
     */
    public static final class Notes implements BaseColumns {
        // This class cannot be instantiated
        private Notes() {
        }

        public static final String[] NOTE_PROJECTION = new String[] {
                Notes._ID, // 0
                Notes.NOTE, // 1
                Notes.TITLE,// 2
                Notes.MODIFIED_DATE,// 3
                Notes.TYPE,// 4
                Notes.LOCK, // 5
                Notes.COLOR,// 6
                Notes.REMIND,// 7
                Notes.REMIND_TIME,// 8
        };

        /**
         * The content:// style URL for this table
         */
        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/notes");

        /**
         * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
         */
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.zcp.note";

        /**
         * The MIME type of a {@link #CONTENT_URI} sub-directory of a single
         * note.
         */
        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.zcp.note";

        /**
         * The default sort order for this table
         */
        public static final String DEFAULT_SORT_ORDER = "modified DESC";

        /**
         * The title of the note
         * <P>
         * Type: TEXT
         * </P>
         */
        public static final String TITLE = "title";

        /**
         * The note itself
         * <P>
         * Type: TEXT
         * </P>
         */
        public static final String NOTE = "note";

        /**
         * lock or unlock
         * <P>
         * Type: INTERGER(0:unlock,1:lock)
         */
        public static final String LOCK = "lock";

        /**
         * remind or unRemind
         * <P>
         * Type: INTERGER(0:unRemain,1:remain)
         */
        public static final String REMIND = "remind";

        /**
         * The remind time
         * <P>
         * Type: TEXT
         * </P>
         */
        public static final String REMIND_TIME = "remind_time";

        /**
         * shortcut_name
         * <P>
         * Type: TEXT
         * </P>
         */
        public static final String SHORTCUT_NAME = "shortcut_name";

        /**
         * type
         * <P>
         * Type: INTERGER(0:text,1:checklist)
         */
        public static final String TYPE = "type";

        public static final int TYPE_TEXT = 0;

        public static final int TYPE_CHECKLIST = 1;

        /**
         * The timestamp for when the note was created
         * <P>
         * Type: INTEGER (long from System.curentTimeMillis())
         * </P>
         */
        public static final String CREATED_DATE = "created";

        /**
         * The timestamp for when the note was last modified
         * <P>
         * Type: INTEGER (long from System.curentTimeMillis())
         * </P>
         */
        public static final String MODIFIED_DATE = "modified";

        /**
         * The color of the note
         * <P>
         * Type: TEXT
         * </P>
         */
        public static final String COLOR = "color";

        public static class Color {
            public static final String BLUE = "blue";

            public static final String GREEN = "green";

            public static final String ORANGE = "orange";

            public static final String PINK = "pink";

            public static final String PURPLE = "purple";
        }
    }

    public static class DataValue {
        public static final int IS_LOCK = 1;

        public static final int IS_UNLOCK = 0;

        public static final int IS_REMIND = 1;

        public static final int IS_UNREMIND = 0;
    }

}
